import pandas as pd
from matplotlib import pyplot as plt

def data_plot():
    #引入json文件
	df = pd.read_json('user_study.json')

	data = df.groupby('user_id').sum().head(50000)

	fig = plt.figure()

	ax = fig.add_subplot(1,1,1)
    #x坐标轴名称
	ax.set_xlabel('User ID')
    #y坐标轴名称
	ax.set_ylabel('Study Time')
    #线型图标题为StudyData
	ax.set_title('StudyData')
    #plot函数绘制线型图，并不传入参数
	ax.plot(data.index,data.minutes)
	plt.show()
    #返回ax
	return ax

if __name__ =='__main__':
	data_plot()